package br.com.firula.to;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="estado")
@SequenceGenerator(name="SEQUENCE", sequenceName="estado_seq")
@Inheritance(strategy=InheritanceType.JOINED)
public class EstadoTO extends BaseTO{

	private static final long serialVersionUID = -5688951171856814301L;

	@Id
	@Column(name="id", nullable=false)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;

	@Column(name="nome", nullable=false)
	private String nome;

	@Column(name="sigla", nullable=false)
	private String sigla;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "estado")
	private List<TimeTO> times;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "estado")
	private List<CampeonatoTO> campeonatos;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idPais", nullable = true)
	private PaisTO pais;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getSigla() {
		return sigla;
	}

	public void setSigla(String sigla) {
		this.sigla = sigla;
	}

	public List<TimeTO> getTimes() {
		return times;
	}

	public void setTimes(List<TimeTO> times) {
		this.times = times;
	}

	public List<CampeonatoTO> getCampeonatos() {
		return campeonatos;
	}

	public void setCampeonatos(List<CampeonatoTO> campeonatos) {
		this.campeonatos = campeonatos;
	}

	public PaisTO getPais() {
		return pais;
	}

	public void setPais(PaisTO pais) {
		this.pais = pais;
	}

	@Override
	public String getAbreviation() {
		// TODO Auto-generated method stub
		return null;
	}

}
